package com.xinkao.log.util;

import java.util.List;
import java.util.UUID;

/**
 * @author: LXF
 * @date: 2017/10/24 10:16
 */
public class StringTools {

	public static boolean isNullOrEmpty(String str) {
		return null == str || "".equals(str) || "null".equals(str);
	}

	public static boolean isNullOrEmpty(Object obj) {
		return null == obj || "".equals(obj);
	}

	public static String getUuid() { return UUID.randomUUID().toString().replace("-", ""); }

	/**
	 * 判断两个集合的元素是否完全相等
	 * @param list
	 * @param list1
	 * @return
	 */
	public static boolean checkEquals(List<String> list, List<String> list1) {
		long st = System.nanoTime();
		if(list.size() != list1.size()) {
			return false;
		}
		for(String str : list) {
			if(!list1.contains(str)) {
				return false;
			}
		}
		return true;
	}
}
